Now, these states are depending on the widget class.
static void gail_box_init (GailBox *box);
static void gail_box_initialize (AtkObject *accessible,
gpointer data);
-static AtkStateSet* gail_box_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailBox, gail_box, GAIL_TYPE_CONTAINER)
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_box_initialize;
- class->ref_state_set = gail_box_ref_state_set;
}
static void
accessible->role = ATK_ROLE_FILLER;
}
-
-static AtkStateSet*
-gail_box_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gail_box_parent_class)->ref_state_set (accessible);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
-
- if (widget == NULL)
- return state_set;
-
- if (GTK_IS_VBOX (widget) || GTK_IS_VBUTTON_BOX (widget))
- atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
- else if (GTK_IS_HBOX (widget) || GTK_IS_HBUTTON_BOX (widget))
- atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
-
- return state_set;
-}
gpointer data);
static void gail_paned_size_allocate_gtk (GtkWidget *widget,
GtkAllocation *allocation);
-
-static AtkStateSet* gail_paned_ref_state_set (AtkObject *accessible);
-
static void atk_value_interface_init (AtkValueIface *iface);
static void gail_paned_get_current_value (AtkValue *obj,
GValue *value);
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- class->ref_state_set = gail_paned_ref_state_set;
class->initialize = gail_paned_real_initialize;
}
{
}
-static AtkStateSet*
-gail_paned_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gail_paned_parent_class)->ref_state_set (accessible);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
-
- if (widget == NULL)
- return state_set;
-
- if (GTK_IS_VPANED (widget))
- atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
- else if (GTK_IS_HPANED (widget))
- atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
-
- return state_set;
-}
-
static void
gail_paned_real_initialize (AtkObject *obj,
gpointer data)
static void gail_range_finalize (GObject *object);
-static AtkStateSet* gail_range_ref_state_set (AtkObject *obj);
-
-
static void gail_range_real_notify_gtk (GObject *obj,
GParamSpec *pspec);
widget_class->notify_gtk = gail_range_real_notify_gtk;
- class->ref_state_set = gail_range_ref_state_set;
class->initialize = gail_range_real_initialize;
gobject_class->finalize = gail_range_finalize;
obj->role = ATK_ROLE_SLIDER;
}
-static AtkStateSet*
-gail_range_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
- GtkRange *range;
-
- state_set = ATK_OBJECT_CLASS (gail_range_parent_class)->ref_state_set (obj);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-
- if (widget == NULL)
- return state_set;
-
- range = GTK_RANGE (widget);
-
- /*
- * We do not generate property change for orientation change as there
- * is no interface to change the orientation which emits a notification
- */
- if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
- atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
- else
- atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
-
- return state_set;
-}
-
-static void
+static void
atk_value_interface_init (AtkValueIface *iface)
{
iface->get_current_value = gail_range_get_current_value;
iface->set_current_value = gail_range_set_current_value;
}
-static void
+static void
gail_range_get_current_value (AtkValue *obj,
GValue *value)
{
static void gail_separator_init (GailSeparator *accessible);
static void gail_separator_initialize (AtkObject *accessible,
gpointer data);
-static AtkStateSet* gail_separator_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET)
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gail_separator_initialize;
- class->ref_state_set = gail_separator_ref_state_set;
}
static void
accessible->role = ATK_ROLE_SEPARATOR;
}
-
-static AtkStateSet*
-gail_separator_ref_state_set (AtkObject *accessible)
-{
- AtkStateSet *state_set;
- GtkWidget *widget;
-
- state_set = ATK_OBJECT_CLASS (gail_separator_parent_class)->ref_state_set (accessible);
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
-
- if (widget == NULL)
- return state_set;
-
- if (GTK_IS_VSEPARATOR (widget))
- atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
- else if (GTK_IS_HSEPARATOR (widget))
- atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
-
- return state_set;
-}
{
atk_state_set_add_state (state_set, ATK_STATE_DEFAULT);
}
+
+ if (GTK_IS_ORIENTABLE(widget))
+ switch (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)))
+ {
+ case GTK_ORIENTATION_HORIZONTAL:
+ atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
+ break;
+
+ case GTK_ORIENTATION_VERTICAL:
+ atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
+ break;
+ }
}
return state_set;
}
state = ATK_STATE_SENSITIVE;
value = gtk_widget_get_sensitive (widget);
}
+ else if (strcmp (pspec->name, "orientation") == 0)
+ {
+ GtkOrientable *orientable;
+
+ orientable = GTK_ORIENTABLE (widget);
+
+ state = ATK_STATE_HORIZONTAL;
+ value = (gtk_orientable_get_orientation (orientable) == GTK_ORIENTATION_HORIZONTAL);
+ }
else
return;
if (state == ATK_STATE_SENSITIVE)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, value);
+ if (state == ATK_STATE_HORIZONTAL)
+ atk_object_notify_state_change (atk_obj, ATK_STATE_VERTICAL, !value);
}
static void